package com.rt.system.service.impl;

import java.util.List;

import com.rt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rt.system.mapper.RtQuestionTypeModuleMapper;
import com.rt.system.domain.RtQuestionTypeModule;
import com.rt.system.service.IRtQuestionTypeModuleService;

/**
 * 题型模块Service业务层处理
 * 
 * @author Yg
 * @date 2022-04-13
 */
@Service
public class RtQuestionTypeModuleServiceImpl implements IRtQuestionTypeModuleService 
{
    @Autowired
    private RtQuestionTypeModuleMapper rtQuestionTypeModuleMapper;

    /**
     * 查询题型模块
     * 
     * @param id 题型模块主键
     * @return 题型模块
     */
    @Override
    public RtQuestionTypeModule selectRtQuestionTypeModuleById(Long id)
    {
        return rtQuestionTypeModuleMapper.selectRtQuestionTypeModuleById(id);
    }

    /**
     * 查询题型模块列表
     * 
     * @param rtQuestionTypeModule 题型模块
     * @return 题型模块
     */
    @Override
    public List<RtQuestionTypeModule> selectRtQuestionTypeModuleList(RtQuestionTypeModule rtQuestionTypeModule)
    {
        return rtQuestionTypeModuleMapper.selectRtQuestionTypeModuleList(rtQuestionTypeModule);
    }

    /**
     * 新增题型模块
     * 
     * @param rtQuestionTypeModule 题型模块
     * @return 结果
     */
    @Override
    public int insertRtQuestionTypeModule(RtQuestionTypeModule rtQuestionTypeModule)
    {
        rtQuestionTypeModule.setCreateTime(DateUtils.getNowDate());
        return rtQuestionTypeModuleMapper.insertRtQuestionTypeModule(rtQuestionTypeModule);
    }

    /**
     * 修改题型模块
     * 
     * @param rtQuestionTypeModule 题型模块
     * @return 结果
     */
    @Override
    public int updateRtQuestionTypeModule(RtQuestionTypeModule rtQuestionTypeModule)
    {
        rtQuestionTypeModule.setUpdateTime(DateUtils.getNowDate());
        return rtQuestionTypeModuleMapper.updateRtQuestionTypeModule(rtQuestionTypeModule);
    }

    /**
     * 批量删除题型模块
     * 
     * @param ids 需要删除的题型模块主键
     * @return 结果
     */
    @Override
    public int deleteRtQuestionTypeModuleByIds(Long[] ids)
    {
        return rtQuestionTypeModuleMapper.deleteRtQuestionTypeModuleByIds(ids);
    }

    /**
     * 删除题型模块信息
     * 
     * @param id 题型模块主键
     * @return 结果
     */
    @Override
    public int deleteRtQuestionTypeModuleById(Long id)
    {
        return rtQuestionTypeModuleMapper.deleteRtQuestionTypeModuleById(id);
    }

    @Override
    public String selectRtQuestionTypeModuleByName(RtQuestionTypeModule rtQuestionTypeModule) {
        return rtQuestionTypeModuleMapper.selectRtQuestionTypeModuleByName(rtQuestionTypeModule);
    }
}
